<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
            background: #f5f5f5;
        }
        .test-container {
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .status {
            padding: 10px;
            margin: 10px 0;
            border-radius: 4px;
        }
        .success { background: #d4edda; color: #155724; }
        .error { background: #f8d7da; color: #721c24; }
        .info { background: #d1ecf1; color: #0c5460; }
    </style>
</head>
<body>
    <div class="test-container">
        <h1>网站加载测试</h1>
        <p>正在测试 http://47.115.205.12/BCAI/ 的加载情况...</p>

        <div id="test-results"></div>

        <button onclick="testWebsite()">开始测试</button>
        <button onclick="testStylesheet()">测试样式表</button>
        <button onclick="testScript()">测试脚本</button>
    </div>

    <script>
        function addStatus(message, type = 'info') {
            const results = document.getElementById('test-results');
            const div = document.createElement('div');
            div.className = `status ${type}`;
            div.textContent = message;
            results.appendChild(div);
        }

        function testWebsite() {
            addStatus('开始测试网站...', 'info');

            fetch('http://47.115.205.12/BCAI/')
                .then(response => {
                    addStatus(`响应状态: ${response.status}`, response.ok ? 'success' : 'error');
                    return response.text();
                })
                .then(html => {
                    addStatus(`HTML长度: ${html.length} 字符`, 'success');
                    if (html.includes('id="app"')) {
                        addStatus('找到app元素', 'success');
                    } else {
                        addStatus('未找到app元素', 'error');
                    }
                })
                .catch(error => {
                    addStatus(`错误: ${error.message}`, 'error');
                });
        }

        function testStylesheet() {
            addStatus('测试样式表加载...', 'info');

            const link = document.createElement('link');
            link.rel = 'stylesheet';
            link.href = 'http://47.115.205.12/BCAI/assets/index-2311e6dc.css';

            link.onload = () => addStatus('样式表加载成功', 'success');
            link.onerror = () => addStatus('样式表加载失败', 'error');

            document.head.appendChild(link);
        }

        function testScript() {
            addStatus('测试脚本加载...', 'info');

            const script = document.createElement('script');
            script.src = 'http://47.115.205.12/BCAI/assets/index-6972fd23.js';

            script.onload = () => addStatus('脚本加载成功', 'success');
            script.onerror = () => addStatus('脚本加载失败', 'error');

            document.head.appendChild(script);
        }
    </script>
</body>
</html>